using System;
using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities;

namespace ThridGroup.ERP.WarehouseManagement
{
    /// <summary>
    /// 库位设置
    /// </summary>
    [Table("WarehouseLocationSetting")]
    public class WarehouseLocationSettingModel : Entity<int>
    {
        /// <summary>
        /// 库位编码
        /// </summary>
        [Column("LocationCode")]
        public string LocationCode { get; set; } = string.Empty;
        
        /// <summary>
        /// 库位名称
        /// </summary>
        [Column("LocationName")]
        public string LocationName { get; set; } = string.Empty;
        
        /// <summary>
        /// 所属库区ID
        /// </summary>
        [Column("WarehouseAreaId")]
        public int WarehouseAreaId { get; set; }
        
        /// <summary>
        /// 面积
        /// </summary>
        [Column("Area")]
        public decimal Area { get; set; }
        
        /// <summary>
        /// 最大载重量
        /// </summary>
        [Column("MaxCapacity")]
        public decimal MaxCapacity { get; set; }
        
        /// <summary>
        /// 库位坐标X
        /// </summary>
        [Column("LocationX")]
        public int LocationX { get; set; }
        
        /// <summary>
        /// 库位坐标Y
        /// </summary>
        [Column("LocationY")]
        public int LocationY { get; set; }
        
        /// <summary>
        /// 库位坐标Z
        /// </summary>
        [Column("LocationZ")]
        public int LocationZ { get; set; }
        
        /// <summary>
        /// 是否已使用
        /// </summary>
        [Column("IsUsed")]
        public bool IsUsed { get; set; }
        
        /// <summary>
        /// 备注
        /// </summary>
        [Column("Remark")]
        public string Remark { get; set; } = string.Empty;
        
        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("CreatedTime")]
        public DateTime CreatedTime { get; set; } = DateTime.Now;
        
        /// <summary>
        /// 更新时间
        /// </summary>
        [Column("UpdatedTime")]
        public DateTime? UpdatedTime { get; set; }
        
        // 以下字段在数据库中不存在，但在业务逻辑中需要
        [NotMapped]
        public string WarehouseAreaName { get; set; } = string.Empty;
        
        [NotMapped]
        public string WarehouseName { get; set; } = string.Empty;
        
        /// <summary>
        /// 所属库区（导航属性，表示一个库位属于一个库区）
        /// </summary>
        [ForeignKey("WarehouseAreaId")]
        [NotMapped]
        public virtual WarehouseAreaSettingModel WarehouseArea { get; set; }
    }
} 